package com.dictionary.cn.core.dictionaryservice.base;

import java.lang.reflect.ParameterizedType;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;

import com.dictionary.cn.core.dictionaryservice.dcitionarybean.Dictionary;

public abstract class BaseDictionaryService<T extends Dictionary> {
    
    @Autowired
    protected JdbcTemplate jdbcTemplate;
    protected String type;
    protected String param;

    @SuppressWarnings("unchecked")
    public Class<T> getRowMapperClass(){
        ParameterizedType type = (ParameterizedType)this.getClass().getGenericSuperclass();
        return (Class<T>) type.getActualTypeArguments()[0];
    };
}
